import React, { Component } from 'react';
import {
  TouchableOpacity,
  View
} from 'react-native';
import ImagePicker from 'react-native-image-crop-picker';
import Ionicons from 'react-native-vector-icons/Ionicons';

export default class Camera extends Component {
  constructor (props) {
    super(props);
  };

  handleImage = () => {
    ImagePicker.openPicker({
      width: 300,
      height: 400,
      cropping: true
    }).then(image => {
      console.log(image);
    });
  };

  render() {
    return(
      <View style={{ flex: 1 }}>
        <TouchableOpacity
          style={{ paddingHorizontal: 20, paddingVertical: 10 }}
          onPress={this.handleImage}
        >
          <Ionicons name={'ios-camera-outline'} size={48} color={'#000000'} />
        </TouchableOpacity>
      </View>
    )
  };
}
